const yargs = require('yargs');
const yq = require('./index');

const email_to = yargs.argv.to;
const email_user = yargs.argv.user;
const email_password = yargs.argv.pwd;

if (yargs.argv.hasOwnProperty('cron')) {
  const e_cron = yargs.argv.cron.replace(/,/gi, ' ');
  yq.get_data_schedule(e_cron, email_user, email_password, email_to);
} else {
  yq.get_data(email_user, email_password, email_to);
}